import request from '@/utils/request'


export function getAdminList(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/user/listUser',
    method: 'post',
    data: params
  })
}

export function addAdmin(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/user/add',
    method: 'post',
    data: params
  })
}

export function editAdmin(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/user/updateUser',
    method: 'post',
    data: params
  })
}

export function deleteAdmin(param) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/user/delete/'+param,
    method: 'get'
  })
}

export function restPwdAdmin(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/restPwd',
    method: 'post',
    params
  })
}

/**
 * 获取在线的管理员列表
 * @param params
 */
export function getOnlineAdminList(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/getOnlineAdminList',
    method: 'get',
    params
  })
}

/**
 * 强退用户
 * @param params
 */
export function forceLogout(params) {
  return request({
    url: process.env.VUE_APP_ADMIN_API + '/admin/forceLogout',
    method: 'post',
    data: params
  })
}
